home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d918.lha / MultiPlot / Rexx / Scripts / shiftY.mpt < prev    next >
Text File  |  1993-10-04  |  1KB  |  61 lines

  1. /* This script transforms the Y values by an
  2. amount requested by user. */
  3.  
  4.  
  5. port= 'MULTIPLOT.01'
  6. RESULT=''
  7. RC=0
  8.  
  9. /* Check Multiplot is running */
  10. options results
  11. if(~show('p',port)) then do
  12.   say "Please start Multiplot first."
  13.   exit 1
  14. end
  15. address value port
  16. 'QUERY'
  17. if(rc ~=0) then do
  18.   say "QUERY command failed!"
  19.   exit 1
  20. end
  21.  
  22. /* Check a PLOT WINDOW is activated */
  23. if(compare('PLOWIN',RESULT)<6) then do
  24.   'SAY Please select a PLOT WINDOW first'
  25.   exit 1
  26. end
  27.  
  28. /* Check a data set is selected and find out which one */
  29. 'PEEK 1 NOVALS'
  30. if(rc ~=0) then do
  31.   'SAY Please select a Data Set first'
  32.   exit 1
  33. end
  34. say NOVALS
  35. 'LAUNCH'
  36. 'QUE'
  37. setno=word(RESULT,words(RESULT))
  38. 'STOP'
  39.  
  40. /* Get value to shift by and change Y values */
  41. 'PULL AREXX: Please enter shift value'
  42. val=RESULT
  43. do i=1 to NOVALS
  44.   'SELECT SET 'setno
  45.   'SELECT POINT ' i
  46.   'SELECT REPLACE'
  47.   'PEEK 1'
  48.   xvar=WORD(POINT,1)
  49.   yvar=WORD(POINT,2)
  50.   POINT=DELWORD(POINT,1,2)
  51.   yvar=yvar + val
  52.   POINT=INSERT(' ',POINT)
  53.   POINT=INSERT(yvar,POINT)
  54.   POINT=INSERT(' ',POINT)
  55.   POINT=INSERT(xvar,POINT)
  56.   POKE 1
  57. end
  58.  
  59. /* Replot */
  60. 'FULLPLOT'
  61.